<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>


<script>
    function A(){}
    function B(a){
        this.a = a;
    }
    function C(a){
        if(a){
            this.a = a;
        }
    }
    A.prototype.a = 1;
    B.prototype.a = 1;
    C.prototype.a = 1;

    console.log(new A().a); //? 1
    console.log(new B().a); //? undefined
    console.log(new C(2).a); //? 2
</script>
</body>
</html>
